*******Pew Research Center Poll: January 2008 Political Survey - January 2008
use "Pew Priority/Pew Data/Pew_2008_Jan.dta", clear


*Year
gen year=2008

*CC Priority
recode Q28WF2 ///
		(1=4 "Top priority") ///
		(2=3 "Important but lower priority") ///
		(3=2 "Not too important") ///
		(4=1 "Should not be done") ///
		(else=.), ///
		gen(CCpriority)
lab var CCpriority "Climate Change Priority"

*Party Preference
gen partyDROP = PARTY
replace partyDROP=1 if PARTYLN==1
replace partyDROP=2 if PARTYLN==2
recode partyDROP ///
	(1 = 1 "GOP") ///
	(2 = 3 "Democrat") ///
	(3/9= 2 "Indepedent"), ///
	gen(partyid)
lab var partyid "Party Preference"
drop partyDROP

*Gender
recode SEX ///
	(1=0 "Male") ///
	(2=1 "Female") ///
	(else=.), ///
	gen(female)
lab var female "Female"	

*Age
recode AGE ///
	(98 99=.), ///
	gen(age)
lab var age "Age"

*Cohort
gen age_cohort = year-AGE
replace age_cohort=. if AGE== 98|AGE ==99
recode age_cohort ///
	(1900/1904=1 "1900-1904") ///
	(1905/1909=2 "1905-1909") ///
	(1910/1914=3 "1910-1914") ///
	(1915/1919=4 "1915-1919") ///
	(1920/1924=5 "1920-1924") ///
	(1925/1929=6 "1925-1929") ///
	(1930/1934=7 "1930-1934") ///
	(1935/1939=8 "1935-1939") ///
	(1940/1944=9 "1940-1944") ///
	(1945/1949=10 "1945-1949") ///
	(1950/1954=11 "1950-1954") ///
	(1955/1959=12 "1955-1959") ///
	(1960/1964=13 "1960-1964") ///
	(1965/1969=14 "1965-1969") ///
	(1970/1974=15 "1970-1974") ///
	(1975/1979=16 "1975-1979") ///
	(1980/1984=17 "1980-1984") ///
	(1985/1989=18 "1985-1989") ///
	(1990/1994=19 "1990-1994") ///
	(1995/1999=20 "1995-1999") ///
	(2000/2004=21 "2000-2004"), ///
	gen(cohort)
la var cohort "Age Cohort, 5 yr. intervals"

*Education
recode EDUC ///
	(1 2=1 "<HS") ///
	(3 4=2 "HS Graduate") ///
	(5=3 "Some College") ///
	(6 7 8=4 "College Graduate") ///
	(else=.), ///
	gen(education)
lab var education "Education"

*Racial Identity
recode RACETHN ///
	(1=1 "White") ///
	(2=2 "Black") ///
	(3=3 "Hispanic") ///
	(4=4 "Other") ///
	(else=.), ///
	gen(race)
lab var race "Racial Identity"

*Rural Inhabitance
recode DENSITY3 ///
	(1=5 "Lowest density") ///
	(2=4) ///
	(3=3 "Middle density") ///
	(4=2) ///
	(5=1 "Highest density") ///
	(else=.), ///
	gen(density)
lab var density "Population Density"

recode USR1 ///
	(1 2=0 "Sub/Urban") ///
	(3=1 "Rural") ///
	(else=.), ///
	gen(rural)
lab var rural "Rural Inhabitance"
	
*Southern State
recode CREGION ///
	(1 2 4 = 0 "not South") ///
	(3=1 "South") ///
	(else=.), ///
	gen(south)
lab var south "Southern State"


*weight
gen weight=WEIGHT

*ID
gen id=PSRAID+20080000

*Keep and save
keep CCpriority partyid female age ///
	education race density rural south ///
	year weight id cohort
save "Pew Priority/Individual Recoded Pew Files/Pew_2008_Jan_Recode", replace
